<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<form enctype="multipart/form-data" method="post" th:action="@{/upload}">
    图片<input type="file" name="file"/>
    <input type="submit" value="上传"/>
</form>


<img th:src="@{/images/demo.jpg}">

<p th:text="${#httpServletRequest.getContextPath()}"></p>
<p th:text="${#servletContext.contextPath}"></p>
<!--<p th:text="${#session.getAttribute('foo')}"></p>-->

<script th:inline="javascript">
    var ROOT = [[${#httpServletRequest.getContextPath()}]];
    console.log(ROOT);
</script>


</body>
</html>